<!-- NEW TOP MENU -->
<ul id="nav" class="dropdown dropdown-linear">
    <li><a onclick="this.blur();" href="./"><?php echo $_lang["dashboard"]; ?></a></li>
    <li class="dir"><span><?php echo $_lang["site"]; ?></span>
        <ul>
            <li><a onclick="this.blur();" target="_blank" href="<?php echo www_base_path; ?>?z=manprev" rel="external"><?php echo $_lang["launch_site"]; ?></a></li>
            <?php if ($_SESSION['permissions']['empty_cache'] == 1) { ?>
            <li><a onclick="this.blur(); Etomite.syncSite();" href="javascript:;"><?php echo $_lang["refresh_site"]; ?></a></li>
            <?php } ?>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('showSiteSchedule');" href="javascript:;"><?php echo $_lang["site_schedule"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.showVisitorStats();" href="javascript:;"><?php echo $_lang["visitor_stats"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('showOnlineVisitors');" href="javascript:;"><?php echo $_lang["visitor_stats_online"]; ?></a></li>
        </ul>
    </li>
    <?php  if($_SESSION['permissions']['new_document']==1) { ?>
    <li class="dir"><span><?php echo $_lang["content"]; ?></span>
        <ul>
            <li><a onclick="this.blur(); Etomite.editDocument('');" href="javascript:;"><?php echo $_lang["add_document"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.editDocument('', 'true');" href="javascript:;"><?php echo $_lang["add_weblink"]; ?></a></li>
        </ul>
    </li>
    <?php } ?>
    <?php if($_SESSION['permissions']['messages']==1 || $_SESSION['permissions']['change_password']==1) { ?>
    <li class="dir"><span><?php echo $_lang["my_etomite"]; ?></span>
        <ul>
        <?php if($_SESSION['permissions']['messages']==1) { ?>
            <li><a onclick="this.blur(); Etomite.myMessages();" href="javascript:;"><?php echo $_lang["messages"]; ?></a></li>
        <?php } ?>
        <?php if($_SESSION['permissions']['change_password']==1) { ?>
            <li><a onclick="this.blur(); Etomite.changePassword();" href="javascript:;"><?php echo $_lang["change_password"]; ?></a></li>
        <?php } ?>
        </ul>
    </li>
    <?php } ?>
    <?php if($_SESSION['permissions']['new_user']==1 || $_SESSION['permissions']['edit_user']==1 || $_SESSION['permissions']['new_role']==1 || $_SESSION['permissions']['edit_role']==1 || $_SESSION['permissions']['access_permissions']==1) { ?>
    <li class="dir"><span><?php echo $_lang["users"]; ?></span>
        <ul>
        <?php if($_SESSION['permissions']['edit_user']==1) { ?>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadUsersView');" href="javascript:;"><?php echo $_lang["user_management_title"]; ?></a></li>
        <?php } ?>
        	<li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadGroupsView');" href="javascript:;"><?php echo $_lang['group_management_title']; ?></a></li>
        <?php /*if($_SESSION['permissions']['access_permissions']==1) { ?>
            <li><a onclick="this.blur();" href="javascript:;"><?php echo $_lang["access_permissions"]; ?></a></li>
        <?php }*/ ?>
        </ul>
    </li>
    <?php }
        $allow_resource = false;
        foreach ($resourcePermsArr as $perm) {
            if ($etomite->checkUserRole($perm, $_SESSION['internalKey'])) {
                $allow_resource = true;
            }
        }
    ?>
    <?php if($allow_resource) { ?>
    <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadResourcesView');" href="javascript:;"><?php echo $_lang["resource_management"]; ?></a></li>
    <?php } ?>
    <li id="module-nav-list" class="dir"><span><?php echo $_lang['module_management']; ?></span>
        <?php
        echo $etomite->buildAdminModuleMenu();
        ?>
    </li>
    <?php if($_SESSION['permissions']['settings']==1 || $_SESSION['permissions']['edit_parser']==1 || $_SESSION['permissions']['logs']==1 || $_SESSION['permissions']['file_manager']==1 || $_SESSION['permissions']['export_html']==1) { ?>
    <li class="dir"><span><?php echo $_lang["administration"]; ?></span>
        <ul>
        <?php if($_SESSION['permissions']['settings']==1) { ?>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('showSiteSettings');" href="javascript:;"><?php echo $_lang["edit_settings"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadSystemInfo');" href="javascript:;"><?php echo $_lang["view_sysinfo"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.removeLocks();" href="javascript:;"><?php echo $_lang["remove_locks"]; ?></a></li>
        <?php } ?>
        <?php if($_SESSION['permissions']['logs']==1) { ?>
            <!-- <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadAuditTrail');" href="javascript:;"><?php echo $_lang["view_logging"]; ?></a></li> -->
        <?php } ?>
        <?php if($_SESSION['permissions']['file_manager']==1) { ?>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('manageFiles');" href="javascript:;"><?php echo $_lang["manage_files"]; ?></a></li>
        <?php } ?>
        <?php   if($_SESSION['permissions']['export_html']==1) { ?>
            <li><a onclick="this.blur();" href="index.php?a=83"><?php echo $_lang["export_site"]; ?></a></li>
        <?php } ?>
            <li><a id="moduleNav" onclick="this.blur(); Etomite.installModule();" href="javascript:;"><?php echo $_lang["manage_modules"]; ?></a></li>
        </ul>
    </li>
    <?php } ?>
    <?php if($_SESSION['permissions']['help']==1) { ?>
    <li class="dir"><span><?php echo $_lang["help"]; ?></span>
        <ul>
            <!-- <li><a onclick="this.blur();" href="javascript:openCredits();"><?php echo $_lang["credits"]; ?></a></li> -->
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadHelp');" href="javascript:;"><?php echo $_lang["help"]; ?></a></li>
            <li><a onclick="this.blur(); Etomite.loadPaneFromAction('loadAbout');" href="javascript:;"><?php echo $_lang["about"]; ?></a></li>
        </ul>
    </li>
    <?php } ?>
    <li><a onclick="this.blur();" href="?logout=1"><?php echo $_lang["logout"]; ?></a></li>
</ul>